package m_utils

import (
	"github.com/rs/xid"
	"golang.org/x/crypto/bcrypt"
)

/*
*
类似雪花算法
*/
func GenXid() string {
	return xid.New().String()
}

func CompareHashAndPassword(e string, p string) (bool, error) {
	err := bcrypt.CompareHashAndPassword([]byte(e), []byte(p))
	if err != nil {
		return false, err
	}
	return true, nil
}
